Skip to content

[2.0.x] Add TMC2130 sensorless probing#9582

Merged
thinkyhead merged 2 commits intoMarlinFirmware:bugfix-2.0.xfrom
tcm0116:2.0.x-sensorless_probing
Sep 30, 2018
Merged

[2.0.x] Add TMC2130 sensorless probing#9582
thinkyhead merged 2 commits intoMarlinFirmware:bugfix-2.0.xfrom
tcm0116:2.0.x-sensorless_probing

Conversation

@tcm0116
Copy link
Copy Markdown
Contributor

@tcm0116 tcm0116 commented Feb 11, 2018

This PR adds the ability to use the stall guard feature of the TMC2130 to enable using the nozzle as a bed probe. I've tested it on my delta machine, and it seems to work pretty well (as can be seen in https://www.youtube.com/watch?v=xb8dM9duGOs). Mileage will vary with cartesian machines that use lead screws or threaded rods, but I think it's definitely viable on delta machines.

For reference, on my machine, I'm using the traditional max endstops and I have the TMC2130 DIAG1 outputs connected to the min endstops. It should be possible to use both SENSORLESS_HOMING and SENSORLESS_PROBING at the same time, but the DIAG1 outputs of the TMC2130s would need to be connected to both max and min endstops in parallel (or the pins file modified to use the same pins for both).

@teemuatlut
Copy link
Copy Markdown
Member

I still think this should be Delta only.
Too many steps per mm to be accurate and enough torque to bend the bed or damage the nozzle.

@tcm0116
Copy link
Copy Markdown
Contributor Author

tcm0116 commented Feb 11, 2018

That's why I put the following caution in the description of the SENSORLESS_PROBING feature.

CAUTION: This could cause damage to machines that use a lead screw or threaded rod
         to move the Z axis. Extreme care must be taken when attempting to enable
         this feature.

@teemuatlut
Copy link
Copy Markdown
Member

I think I'd rather see #if ENABLED(DELTA) and then remove it if someone can show it working safely on a lead screw driven system.

@thinkyhead
Copy link
Copy Markdown
Member

thinkyhead commented Feb 12, 2018

With the addition of these sensitive features, maybe it would be good to have a separate sketch that does testing on the stepper drivers to figure out the proper value limits and ranges —especially for stall sensitivity— so users can be pretty confident about them before plugging them into Marlin and leaping straight to G29.

Or… have a marlin_calibrated flag that is false by default, and only gets set true after the machine has been put through an initial setup and testing procedure. Until that flag is set (requiring an EEPROM) the firmware will always boot into the setup procedure.

@tcm0116
Copy link
Copy Markdown
Contributor Author

tcm0116 commented Feb 12, 2018

For this, I just used G30 and M914 to dial in the stall sensitivities prior to moving on to G33 and G29.

Also, I believe having a separate sketch isn't currently possible with the LPC1768 HAL.

A calibration procedure would be nice, but isn't always necessary. As I've dialed in the parameters like Z offset and stall sensitivity, I've updated my configuration files, which ensures that the system is safe to operate when updating to newer versions of Marlin.

@thinkyhead
Copy link
Copy Markdown
Member

Holding this until after the 1.1.9 release, which could be pretty soon. Still a few bugs to look into.

@tcm0116
Copy link
Copy Markdown
Contributor Author

tcm0116 commented Feb 14, 2018 via email

@thinkyhead
Copy link
Copy Markdown
Member

I'm referring to bugs generally that I need to look into before releasing 1.1.9. Not bugs in this PR.

@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 6 times, most recently from 2308508 to 1e946d6 Compare March 16, 2018 03:23
@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 2 times, most recently from 9f46c52 to 889fd5f Compare March 31, 2018 23:59
@marcio-ao
Copy link
Copy Markdown
Contributor

marcio-ao commented Apr 2, 2018

I think I'd rather see #if ENABLED(DELTA) and then remove it if someone can show it working safely on a lead screw driven system.

@teemuatlut : We have printers we are working on which use a belted Z axis with direct (non-geared) drive, so the assumption that if it is a Cartesian it has gearing and/or a lead-screw is soon-to-be incorrect. I may give this option a try and see if it works. My concern isn't with damage, but with false positives due to Z binding.

@marcio-ao
Copy link
Copy Markdown
Contributor

Just a heads up that due to #10294, the polarity of DIAG1 will change. Not sure whether this necessitate any corrections to this PR, but since it was related, I thought I would mention it.

@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 3 times, most recently from 68147f7 to e8e6026 Compare April 7, 2018 00:48
@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 3 times, most recently from e0cb8ff to 584735c Compare April 14, 2018 17:28
@mylife4aiurr
Copy link
Copy Markdown

mylife4aiurr commented Apr 18, 2018

@tcm0116 I saw your video. It's nice to use stallguard to get rid of endstops. It's great to make your printer quieter. But using stallguard as a bed probe is like next level.
If it's accurate it would be awesome.
I'd like to try it out and help get it working on another Delta?
Do I simply bridge xyz diag pins together as one output then connect that to zmin?
Not totally sure what changes need to be made on firmware side, but I'd think the firmware would see signal from any diag pin as a probe hit? So I don't think any firmware changes necessary as far stallguard as probe are necessary? Just the bridging of daig pins? Is that correct?

@mylife4aiurr
Copy link
Copy Markdown

Hope this feature gets into 1.1.x as well, please, please.

@tcm0116 tcm0116 force-pushed the 2.0.x-sensorless_probing branch from 455f413 to 5e6aef6 Compare September 9, 2018 19:59
@tcm0116 tcm0116 force-pushed the 2.0.x-sensorless_probing branch from 5e6aef6 to af60249 Compare September 19, 2018 00:07
@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 2 times, most recently from 9d867f9 to 849dea9 Compare September 24, 2018 03:23
@tcm0116 tcm0116 force-pushed the 2.0.x-sensorless_probing branch from af60249 to 7aa0ac1 Compare September 26, 2018 01:58
@thinkyhead
Copy link
Copy Markdown
Member

Current configurations claim that StallGuard is only usable with TMC2130 drivers. But this PR claims it can be used also with TMC2208 drivers. Is the current configuration wrong?

@tcm0116 tcm0116 force-pushed the 2.0.x-sensorless_probing branch from 039381b to 731aeb9 Compare September 28, 2018 02:08
@tcm0116
Copy link
Copy Markdown
Contributor Author

tcm0116 commented Sep 28, 2018

Is the current configuration wrong?

No. I was mistaken. I've updated the configuration files and re-based.

@thinkyhead thinkyhead force-pushed the 2.0.x-sensorless_probing branch 2 times, most recently from 67590da to b67ff9d Compare September 28, 2018 02:16
@thinkyhead
Copy link
Copy Markdown
Member

thinkyhead commented Sep 28, 2018

I've also done a bit of tweaking, rebased, and pushed changes. Did you change anything other than the comments reading // TMC2130/TMC2208 only

…and the sanity checks?

@thinkyhead thinkyhead force-pushed the 2.0.x-sensorless_probing branch 7 times, most recently from ec2e302 to c6f46b0 Compare September 28, 2018 02:38
@thinkyhead
Copy link
Copy Markdown
Member

thinkyhead commented Sep 28, 2018

Ok, should be good to merge once it passes Travis CI. Previously none of the TMC2130 or 2208 tests were being run, so I want to make sure they're all passing now.

@thinkyhead thinkyhead force-pushed the 2.0.x-sensorless_probing branch from c6f46b0 to 24c3f4f Compare September 28, 2018 03:02
@tcm0116
Copy link
Copy Markdown
Contributor Author

tcm0116 commented Sep 28, 2018

…and the sanity checks?

The sanity checks were all correct. It was just the comments that were wrong.

@thinkyhead
Copy link
Copy Markdown
Member

This error message is correct? How do we use it with TMC2208?

#error "SENSORLESS_PROBING requires TMC2130 or TCM2208 drivers for X, Y, and Z."

Also, oops, a little dyslexia fell in with "TCM2208."

@thinkyhead thinkyhead force-pushed the 2.0.x-sensorless_probing branch 2 times, most recently from 8b55d3d to ea9d8ae Compare September 29, 2018 07:21
@Palatis
Copy link
Copy Markdown
Contributor

Palatis commented Sep 29, 2018

hello, @tcm0116, can you give a quick explanation on how you wired the pins?
i would like to give this a try but can't figure out the wiring.

@tcm0116
Copy link
Copy Markdown
Contributor Author

tcm0116 commented Oct 2, 2018

@Palatis - in my setup, I'm using conventional endstops for homing the three towers, which are wired to the X/Y/Z Max inputs on my board. I then have the diag1 output of the TMC2130s wired to the X/Y/Z Min inputs on the board. Marlin is configured with all six of the endstops enabled and SENSORLESS_PROBING enabled. G30 and M914 can be used to determine the proper sensitivity settings for the TMC2130s. I think I'm running the slow probe speed at 40 mm/s and a stall sensitivity of 4 or 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants